﻿using GavinCMS.BLL;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace GavinCMS.Web.Controllers
{
    public class PersonController : Controller
    {
        //
        // GET: /Person/

        public ActionResult Index()
        {
            return View();
        }

        public ActionResult GetData(int page = 1, int rows = 50)
        {
            var personBll = new PersonBLL();
            var count = 0;
            var list = personBll.GetPersons(page, rows, ref count);

            return Json(new
            {
                total = count,
                rows = list
            }, JsonRequestBehavior.AllowGet);
        }

    }
}
